package com.bjsxt.shopping.util;

import java.util.List;

import com.bjsxt.shopping.dao.OrderMysqlDAO;

public class OrderMgr {
    private static OrderMgr om=null;
    private  OrderDAO  dao=null;
    
    static {
    	if(om==null){
    		om=new OrderMgr();
    		om.setDao(new OrderMysqlDAO());
    	}
    }
    private OrderMgr(){
    }
    public static OrderMgr getInstance(){
    	return om;
    }
    
    
    
    
	public OrderDAO getDao() {
		return dao;
	}
	public void setDao(OrderDAO dao) {
		this.dao = dao;
	}
	public boolean save(SalesOrder so){
		return dao.save(so);
	}
	public int getOrders(List<SalesOrder> orders,int pageNo,int PAGE_SIZE){
		return dao.getOrders(orders,pageNo,PAGE_SIZE);
	}
	public SalesOrder loadById(int id){
		return dao.loadById(id);
	}
	
	public List<SalesItem> getSalesItem(SalesOrder so){
		return dao.getSalesItem(so);
		}
	
	public boolean updateStatus(int id,int status){
		return dao.updateStatus(id,status);
	}
}
